﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cqrs.Common;

namespace Cqrs.Common
{
    public abstract class GeneratorModelBase
    {
        public StateMachine StateMachine { get; set; }
        public List<CommandEvent> AdHocMethods { get; set; }
        public string Namespace { get; set; }
        public string DomainName { get; set; }
        public IList<CommandEvent> CommandEventList { private set; get; }
        public IList<DomainProperty> DomainProperties { private set; get; }
        public string SmfFile { get; set; }

        public GeneratorModelBase(
            StateMachine stateMachine,
            List<CommandEvent> adHocMethods,
            string domainNamespace,
            string domainName,
            IList<DomainProperty> domainProperties,
            string smfFile)
        {
            this.Namespace = domainNamespace;
            this.DomainName = domainName;
            this.CommandEventList = stateMachine.UniqueCommandEventList;
            this.DomainProperties = domainProperties;
            this.SmfFile = smfFile;
            this.StateMachine = stateMachine;
            this.AdHocMethods = adHocMethods;
        }

        public abstract string DomainCode { get; }
        public abstract string EventCode { get; }
        public abstract string CommandCode { get; }
        public abstract string CommandHandlerCode { get; }
        public abstract string TestCode { get; }
    }
}
